from pyecharts.charts import Bar
from pyecharts.options import *

bar = Bar()

# 添加x轴数据
bar.add_xaxis(['china', 'American', 'England'])
# 添加y轴数据
bar.add_yaxis('柱状图', [30, 20, 10], label_opts=LabelOpts(position='right'), color='red')
# 反转x和y轴
bar.reversal_axis()

bar.render('基础柱状图构建.html')
